package com.scienzeinternazionali.util;


import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import java.util.Properties;

public class LogFactory {

  public static final String SCIENZEINTERNAZIONALI = "scienzeinternazionali";
  private static Logger logger = null;
  private static Properties prop = null;

  public LogFactory() {
  }

  public static Logger getLogger(String name) {
    if (logger == null) {
      try {
        prop = new Properties();
        prop.load(LogFactory.class.getResourceAsStream("/log4j.properties"));
        PropertyConfigurator.configure(prop);
      }
      catch (Exception ex) {
        ex.printStackTrace();
      }
      logger = Logger.getLogger(name);
    }
    return logger;
  }
}
